﻿using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform.Jwt.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Platform.Jwt.Providers
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister]
    public interface IApiAuthorizationProvider
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="secretKey"></param>
        /// <returns></returns>
        string GetSignatureKey(string appId, string secretKey);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        AppSecret GetAppSecret(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        JsonWebToken LoadAccessToken(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="accessToken"></param>
        void SaveAccessToken(JsonWebToken accessToken);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        ApplicationIdentity GetApplicationIdentity(string appId);
    }
}
